<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let obj = {
            name:'jack',
            age:20
        }
        // 获取当前对象中的键生成一个数组
        let arr = Object.keys(obj)
        console.log(arr)
    </script>
</body>
</html>